import qrcode
from PIL import Image
from pyzbar import pyzbar



def decode(file_path):
    decode_data = pyzbar.decode(Image.open(file_path), symbols=[
        pyzbar.ZBarSymbol.QRCODE])[0].data.decode('utf-8')
    print("解码数据：", decode_data)
    return decode_data

if __name__ == '__main__':
    file_path=r'C:\Users\Administrator\Desktop\3.png'
    decode(file_path)